package com.sinosoft.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * @author loujiang
 * @date 2020/12/21 2:05 下午
 * @NOTE:
 */
@RestController
@RequestMapping("/test")
public class TestController {


    @Autowired
    RestTemplate restTemplate;


    @RequestMapping("/sayHi")
    public String sayHi() {
        //ribbon-producer 微服务名称
        String hello = restTemplate.getForObject("http://ribbon-producer/sayHi", String.class);
        return hello;
    }
}
